import request from '@/utils/request'

// 查询视频列表
export function listVideos(query) {
  return request({
    url: '/business/videos/list',
    method: 'get',
    params: query
  })
}

// 查询视频所有列表
export function listAllVideos(query) {
  return request({
    url: '/business/videos/listAll',
    method: 'get',
    params: query
  })
}

// 查询视频详细
export function getVideos(id) {
  return request({
    url: '/business/videos/getInfo/' + id,
    method: 'get'
  })
}

// 新增视频
export function addVideos(data) {
  return request({
    url: '/business/videos/add',
    method: 'post',
    data: data
  })
}

// 修改视频
export function updateVideos(data) {
  return request({
    url: '/business/videos/edit',
    method: 'post',
    data: data
  })
}

// 删除视频
export function delVideos(id) {
  return request({
    url: '/business/videos/remove/' + id,
    method: 'get'
  })
}
// 根据文件id获取文件流
export function getBlobByFileId(id){
  return request({
    url: '/business/videos/getBlobByFileId/' + id,
    responseType: 'blob',
    method: 'get'
  })
}
